package com.ego.controller;


import com.ego.commons.pojo.EasyUITree;
import com.ego.commons.pojo.EgoResult;
import com.ego.pojo.TbContentCategory;
import com.ego.service.TbContentCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @Title
 * @Author Lyg
 * @Description:
 */
@RestController
public class TbContentCategoryController {

    @Autowired
    private TbContentCategoryService tbContentCategoryService;

    @RequestMapping("/content/category/list")
    public List<EasyUITree> contentCategoryList(@RequestParam(defaultValue = "0")long id){

            return tbContentCategoryService.tbContentCategoryList(id);
    }

    @RequestMapping("/content/category/create")
    public EgoResult contentCategoryCreate(long parentId,String name ){

            return tbContentCategoryService.tbContentCategoryCreate(parentId,name);
    }
    @RequestMapping("/content/category/update")
    public EgoResult contentCategoryUpdate(TbContentCategory tbContentCategory){

        return tbContentCategoryService.contentCategoryUpdate(tbContentCategory);
    }
    @RequestMapping("/content/category/delete/")
    public EgoResult contentCategoryDel(long id){

        return tbContentCategoryService.contentCategoryDel(id);
    }

}
